package com.itheima.app.controller;

import com.itheima.app.manager.MessageManager;
import com.itheima.domain.vo.PageBeanVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MessageController {
    @Autowired
    private MessageManager messageManager;

    //公告列表
    @GetMapping("/messages/announcements")
    public PageBeanVo announcementList(@RequestParam( value = "page",defaultValue = "1") Integer pageNumber,
                                       @RequestParam(value = "pagesize",defaultValue = "10")Integer pageSize){
        return messageManager.announcementList(pageNumber,pageSize);
    }
}
